import { followOrUnfollow } from '@/services/consult';
import { Doctor } from '@/types/consult';
import { ref } from 'vue';

export const loading = ref(false);
export const follow = async (item: Doctor) => {
loading.value = true;
try {
await followOrUnfollow(item.id, 'doc');
item.likeFlag = item.likeFlag === 1 ? 0 : 1;
} finally {
loading.value = false;
}
};
